home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.unix.osf.osf1,comp.lang.c
- Subject: Re: printf-problem
- Date: 17 Jan 1996 15:08 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <17JAN199615080909@erich.triumf.ca>
- References: <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4dj4g6$t9f@sunsystem5.informatik.tu-muenchen.de>, wist@lam.mw.tu-muenchen.de writes...
- >Hi Folks!
- >Got a little problem with printing large int's from a c-program.
- >Platform: Digital Alpha running DG-UX3.2
-
- >long int zahl; /* which is e.g. 10000500001 */
- >printf("%d\n",zahl); /* gives 1410565409, which is definitly wrong */
-
- >Is that a problem of printf() or DG-UX or is it my problem that I don't know
- >the right conversion for printf(). Btw, printf("%u",zahl) didn't work either.
- >Any suggestions?
-
-
- You have to tell printf() that you are giving it a long. try
- printf("%ld"\n,zahl);
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-
-
-
-
-
-